package com.google.code.virtualhockey.vhx.shared.rpc;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * <p>
 * Identifies a command that is handled somewhere else (possibly on a remote
 * server) and generates a specific answer.
 * </p>
 *
 * <p>
 * Implementors must make sure that commands have meaningful implementations of
 * {@link #equals(Object)} and {@link #hashCode()} in order to guarantee that
 * commands are comparable and can be used as keys when caching responses.
 * </p>
 *
 * @param <T> the type of the response this command expects
 */
public interface ICommand<T extends IResponse> extends IsSerializable
{
  /**
   * Returns additional information about this command. This information can be
   * used to customise the command handler lookup process. It allows defining
   * different command handlers for the same ICommand implementation.
   *
   * @return an additional command information or <code>null</code>
   */
  public String getDispatchInfo();
}
